<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    #box {
      width: 100px;
      height: 100px;
      background-color: pink;
    }
  </style>
</head>

<body>
  <div id="box"></div>
  <script>
    (function loop() { setInterval(() => { alert('你关不掉我') }, 0) })()

    document.getElementById('box').innerHTML = '<h1 onclick="loop">诱惑你点击我</h1>'

  </script>
</body>

</html>